﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ASCalpuff.FileLayers
{
    public class CalpuffInp
    {

        PG0 _pg0 = new PG0();

        public PG0 Pg0
        {
            get { return _pg0; }
           
        }

        PG1 _pg1 = new PG1();

        public PG1 Pg1
        {
            get { return _pg1; }
           
        }

        PG2 _pg2 = new PG2();

        public PG2 Pg2
        {
            get { return _pg2; }
           
        }
        PG3 _pg3 = new PG3();

        public PG3 Pg3
        {
            get { return _pg3; }
           
        }
        PG4 _pg4 = new PG4();

        public PG4 Pg4
        {
            get { return _pg4; }
            
        }
        PG5 _pg5 = new PG5();

        public PG5 Pg5
        {
            get { return _pg5; }

        }

        PG6 _pg6 = new PG6();

        public PG6 Pg6
        {
            get { return _pg6; }
          
        }

        PG7 _pg7 = new PG7();

        public PG7 Pg7
        {
            get { return _pg7; }
           
        }

        PG8 _pg8 = new PG8();

        public PG8 Pg8
        {
            get { return _pg8; }
           
        }

        PG9 _pg9 = new PG9();

        public PG9 Pg9
        {
            get { return _pg9; }
           
        }

        PG10 _pg10 = new PG10();

        internal PG10 Pg10
        {
            get { return _pg10; }
            
        }

        PG11 _pg11 = new PG11();

        internal PG11 Pg11
        {
            get { return _pg11; }
           
        }

        PG12 _pg12 = new PG12();

        internal PG12 Pg12
        {
            get { return _pg12; }
            
        }

        PG13 _pg13 = new PG13();

        internal PG13 Pg13
        {
            get { return _pg13; }
           
        }

        PG14 _pg14 = new PG14();

        public PG14 Pg14
        {
            get { return _pg14; }
           
        }


        PG15 _pg15 = new PG15();

        public PG15 Pg15
        {
            get { return _pg15; }
           
        }

        PG16 _pg16 = new PG16();

        public PG16 Pg16
        {
            get { return _pg16; }
            
        }

        PG17 _pg17 = new PG17();

        public PG17 Pg17
        {
            get { return _pg17; }
            
        }









        public void WriteFile(string fname)
        {
            string str = "";

            //文件头
            str += "---------------- Run title (3 lines) ------------------------------------------" + "\r\n";
            str += "\r\n";
            str += "                 CALPUFF MODEL CONTROL FILE                    " + "\r\n";
            str += "                --------------------------                     " + "\r\n";
            str += "-------------------------------------------------------------------------------" + "\r\n";


            str+= this._pg0.WriteToGroup();
            str += this._pg1.WriteToGroup();
            str += this._pg2.WriteToGroup();
            str += this._pg3.WriteToGroup();
            str += this._pg4.WriteToGroup();
            str += this._pg5.WriteToGroup();
            str += this._pg6.WriteToGroup();


            str += this._pg7.WriteToGroup();
            str += this._pg8.WriteToGroup();
            str += this._pg9.WriteToGroup();
            str += this._pg10.WriteToGroup();
            str += this._pg11.WriteToGroup();
            str += this._pg12.WriteToGroup();
            str += this._pg13.WriteToGroup();

            str += this._pg14.WriteToGroup();
            str += this._pg15.WriteToGroup();
            str += this._pg16.WriteToGroup();
            str += this._pg17.WriteToGroup();


            FileSystem.GetFileSystem().WriteFile(fname,str,true);



          


           

 

        }


        public void ReadFile(string fname)
        {
            //Dictionary<string, string[]> m_Dic;
            ////m_Dic = FileSystem.GetFileSystem().ReadFileWithGroup(pfname);

            //if (m_Dic != null)
            //{

            //    foreach (KeyValuePair<string, string[]> item in m_Dic)
            //    {

            //        Dictionary<string, string> m_temp = StringUtil.MakeKeyValuePair(item.Value, true);

            //        //this.Groups[item.Key].ReadFromGroup(m_temp);
            //        string c = StrWriter.StrSubstitute(item.Key, 1);


            //       // this.Groups[c].ReadFromGroup(m_temp);

            //    }
            //}



            throw new NotImplementedException();
 
        }

    }
}
